package com.zz.inventory.domain;

import java.util.Date;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;

/**
 * 学生信息对象 students
 * 
 * @author ruoyi
 * @date 2025-07-03
 */
public class Students extends BaseEntity
{
    @Excel(name = "class_id")
    private Long classId;

    @Excel(name = "student_code")
    private String studentCode;

    /** 学生姓名 */
    @Excel(name = "full_name")
    private String fullName;

    /** 性别 */
    @Excel(name = "gender")
    private String gender;

    @Excel(name = "enrollment_date")
    private String enrollmentDate;

    @TableField(exist = false)
    private Classes classes;

    private static final long serialVersionUID = 1L;

    /** 学生ID */
    @Excel(name = "student_id")
    private Long studentId;

    /** 所属学校ID */
    @Excel(name = "school_id")
    private Long schoolId;

    /** 入学日期 */
    @Excel(name = "create_time", dateFormat = "dd/MM/yyyy HH:mm:ss")
    private Date createTime;

    private String importError;
    private String enrollmentDateRaw;

    public String getEnrollmentDateRaw() {
        return enrollmentDateRaw;
    }

    public void setEnrollmentDateRaw(String enrollmentDateRaw) {
        this.enrollmentDateRaw = enrollmentDateRaw;
    }

    public String getImportError() {
        return importError;
    }

    public void setImportError(String importError) {
        this.importError = importError;
    }

    public Classes getClasses() {
        return classes;
    }

    public void setClasses(Classes classes) {
        this.classes = classes;
    }

    @Override
    public Date getCreateTime() {
        return createTime;
    }

    @Override
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Long getStudentId() {
        return studentId;
    }

    public void setStudentId(Long studentId) {
        this.studentId = studentId;
    }

    public void setSchoolId(Long schoolId)
    {
        this.schoolId = schoolId;
    }

    public Long getSchoolId() 
    {
        return schoolId;
    }

    public void setClassId(Long classId) 
    {
        this.classId = classId;
    }

    public Long getClassId() 
    {
        return classId;
    }

    public void setStudentCode(String studentCode) 
    {
        this.studentCode = studentCode;
    }

    public String getStudentCode() 
    {
        return studentCode;
    }

    public void setFullName(String fullName) 
    {
        this.fullName = fullName;
    }

    public String getFullName() 
    {
        return fullName;
    }

    public void setGender(String gender) 
    {
        this.gender = gender;
    }

    public String getGender() 
    {
        return gender;
    }

    public String getEnrollmentDate() {
        return enrollmentDate;
    }

    public void setEnrollmentDate(String enrollmentDate) {
        this.enrollmentDate = enrollmentDate;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("studentId", getStudentId())
            .append("schoolId", getSchoolId())
            .append("classId", getClassId())
            .append("studentCode", getStudentCode())
            .append("fullName", getFullName())
            .append("gender", getGender())
            .append("enrollmentDate", getEnrollmentDate())
            .append("createTime", getCreateTime())
            .toString();
    }

    /*public void prepareForSave() {
        try {
            this.classId = classIdStr != null ?
                    Long.parseLong(classIdStr.trim()) : null;
        } catch (NumberFormatException e) {
            this.classId = null;
            this.importError = "class_id格式错误";
        }
    }*/
}
